home *** CD-ROM | disk | FTP | other *** search
- Public Class Form1
- Inherits System.Windows.Forms.Form
-
- #Region " Windows Form Designer generated code "
-
- Public Sub New()
- MyBase.New()
-
- 'This call is required by the Windows Form Designer.
- InitializeComponent()
-
- 'Add any initialization after the InitializeComponent() call
-
- End Sub
-
- 'Form overrides dispose to clean up the component list.
- Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
- If disposing Then
- If Not (components Is Nothing) Then
- components.Dispose()
- End If
- End If
- MyBase.Dispose(disposing)
- End Sub
-
- 'Required by the Windows Form Designer
- Private components As System.ComponentModel.IContainer
-
- 'NOTE: The following procedure is required by the Windows Form Designer
- 'It can be modified using the Windows Form Designer.
- 'Do not modify it using the code editor.
- Friend WithEvents Label1 As System.Windows.Forms.Label
- Friend WithEvents Label2 As System.Windows.Forms.Label
- Friend WithEvents btnToDollars As System.Windows.Forms.Button
- Friend WithEvents txtDollars As System.Windows.Forms.TextBox
- Friend WithEvents txtEuros As System.Windows.Forms.TextBox
- Friend WithEvents btnToEuros As System.Windows.Forms.Button
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
- Me.txtDollars = New System.Windows.Forms.TextBox()
- Me.Label1 = New System.Windows.Forms.Label()
- Me.txtEuros = New System.Windows.Forms.TextBox()
- Me.Label2 = New System.Windows.Forms.Label()
- Me.btnToDollars = New System.Windows.Forms.Button()
- Me.btnToEuros = New System.Windows.Forms.Button()
- Me.SuspendLayout()
- '
- 'txtDollars
- '
- Me.txtDollars.Location = New System.Drawing.Point(24, 32)
- Me.txtDollars.Name = "txtDollars"
- Me.txtDollars.Size = New System.Drawing.Size(136, 24)
- Me.txtDollars.TabIndex = 1
- Me.txtDollars.Text = ""
- '
- 'Label1
- '
- Me.Label1.Location = New System.Drawing.Point(24, 8)
- Me.Label1.Name = "Label1"
- Me.Label1.TabIndex = 2
- Me.Label1.Text = "Dollars"
- '
- 'txtEuros
- '
- Me.txtEuros.Location = New System.Drawing.Point(264, 32)
- Me.txtEuros.Name = "txtEuros"
- Me.txtEuros.Size = New System.Drawing.Size(136, 24)
- Me.txtEuros.TabIndex = 3
- Me.txtEuros.Text = ""
- '
- 'Label2
- '
- Me.Label2.Location = New System.Drawing.Point(264, 8)
- Me.Label2.Name = "Label2"
- Me.Label2.TabIndex = 4
- Me.Label2.Text = "Euros"
- '
- 'btnToDollars
- '
- Me.btnToDollars.Location = New System.Drawing.Point(168, 32)
- Me.btnToDollars.Name = "btnToDollars"
- Me.btnToDollars.Size = New System.Drawing.Size(40, 23)
- Me.btnToDollars.TabIndex = 5
- Me.btnToDollars.Text = "<"
- '
- 'btnToEuros
- '
- Me.btnToEuros.Location = New System.Drawing.Point(216, 32)
- Me.btnToEuros.Name = "btnToEuros"
- Me.btnToEuros.Size = New System.Drawing.Size(40, 23)
- Me.btnToEuros.TabIndex = 6
- Me.btnToEuros.Text = ">"
- '
- 'Form1
- '
- Me.AutoScaleBaseSize = New System.Drawing.Size(7, 17)
- Me.ClientSize = New System.Drawing.Size(424, 77)
- Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnToEuros, Me.btnToDollars, Me.txtEuros, Me.Label2, Me.txtDollars, Me.Label1})
- Me.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
- Me.Name = "Form1"
- Me.Text = "Form1"
- Me.ResumeLayout(False)
-
- End Sub
-
- #End Region
-
- ' this converts from dollars to euros
-
- Private Sub btnToEuros_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnToEuros.Click
- ' create an instance of the proxy class
- Dim conv As New localhost.Converter()
- ' get the operand
- Dim value As Decimal = CDec(txtDollars.Text)
- ' call the remote method
- Dim result As Decimal = conv.DollarToEuro(value)
- ' show the result
- txtEuros.Text = result.ToString
- End Sub
-
- ' this converts from euros to dollars
-
- Private Sub btnToDollars_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnToDollars.Click
- ' create an instance of the proxy class
- Dim conv As New localhost.Converter()
- ' get the operand
- Dim value As Decimal = CDec(txtEuros.Text)
- ' call the remote method
- Dim result As Decimal = conv.EuroToDollar(value)
- ' show the result
- txtDollars.Text = result.ToString
- End Sub
-
- ' clear the dollar field when a key is pressed in the euro field
-
- Private Sub txtEuros_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtEuros.KeyPress
- txtDollars.Clear()
- End Sub
-
- ' clear the euro field when a key is pressed in the dollar field
-
- Private Sub txtDollars_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtDollars.KeyPress
- txtEuros.Clear()
- End Sub
- End Class
-